<template>
	<view class="content">
		<view class="content-block">
			<view class="item" @click="navigate('/page_other/serve/specialist_detail?id='+ item.id)" v-for="item in expertList" :key="item.id">
				<view class="photos">
					<image :src="item.coverUrl" mode="" ></image>
				</view>
				<view class="info">
					<view class="name">
						<text>{{item.name}}</text>
					</view>
					<view class="post">
						职务：{{item.duties}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getExpertListApi
	} from '@/api/specialist.js';
	export default{
		data(){
			return{
				expertList: [],
				limit: 3,
				page: 1
			}
		},
		
		methods:{
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			// 专家列表
			getExpertList() {
				getExpertListApi({
					page: 1,
					limit: 3,
				}).then((res) => {
					this.expertList = res.list ?? [];
				})
			},
		},
		onLoad() {
			this.getExpertList();
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		width: 100%;
		height: 100%;
		padding: 20rpx 20rpx;
		
		.content-block{
			width: 100%;
			height: 100%;
			// padding: 20px 20px;
			
			.item{
				width: 100%;
				height: 270rpx;
				padding: 10rpx;
				display: flex;
				background-color: #fff;
				border-radius: 20rpx;
				line-height: 75rpx;
				padding: 20rpx;
				margin-bottom: 30rpx;
				
				.photos{
					width: 200rpx;
					height: 225rpx;
					background-color: #FEF6F4; 
					border-radius: 20rpx;
					image{
						width: 100%;
						height: 100%;
						// border-radius: 20rpx;
					}
				}
				
				.info{
					display: flex;
					flex-direction: column;
					justify-content: center;
					width: calc((100% - 220rpx));
					margin-left: 20rpx;
					.name{
						font-weight: 900;
					}
				}
			}
		}
		
	}
</style>